package ace.cmp.security.core.impl.authorization.impl;

import ace.cmp.security.core.impl.authorization.AuthorizationGenerator;
import ace.cmp.security.core.impl.util.AuthorizationUtils;

/**
 * @author caspar
 * @date 2023/3/7 13:43
 */
public class BasicAuthorizationGeneratorImpl implements AuthorizationGenerator {
  private final String headerValue;

  public BasicAuthorizationGeneratorImpl(String username, String password) {
    this.headerValue = AuthorizationUtils.getBasicAuthorization(username, password);
  }

  @Override
  public String getAuthorizationValue() {
    return this.headerValue;
  }
}
